package com.dkd.common.enums;
public enum UpdateType {
    ADD_FIELD(1, "新增"), UPDATE_FIELD(2, "修改");
    private int code;
    private String name;
    UpdateType(int code, String name) {
        this.code = code;
        this.name = name;
    }
    public String getName() {
        return name;
    }
    public int getCode() {
        return code;
    }
    public static UpdateType getUpdateTypeFromCode(int code) {
        for (UpdateType updateType : UpdateType.values()) {
            if (updateType.getCode() == code) {
                return updateType;
            }
        }
        return null;
    }
}
